package com.dhcc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dhcc.entity.SysDeptPositionUser;
import com.dhcc.mapper.SysDeptPositionUserMapper;
import com.dhcc.service.SysDeptPositionUserService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 机构（部门）-岗位-用户关联 接口实现类
 * @ProjectName Dhcc-Cloud
 * @PackageName com.dhcc.service.impl
 * @Title SysDeptPositionUserServiceImpl
 * @Date 2024/12/5 下午3:12
 * @Author LiuGuoting
 */
@Service
public class SysDeptPositionUserServiceImpl extends ServiceImpl<SysDeptPositionUserMapper, SysDeptPositionUser> implements SysDeptPositionUserService {

    /**
     * 获取用户的部门岗位关联记录列表
     *
     * @param userId
     * @return
     */
    @Override
    public List<SysDeptPositionUser> getIdsByUserId(String userId) {
        LambdaQueryWrapper<SysDeptPositionUser> wrapper = new LambdaQueryWrapper<>();
        return baseMapper.selectList(wrapper.eq(SysDeptPositionUser::getUserId, userId));
    }
}
